package com.finger.crowd.api;

import com.finger.crowd.entity.po.MemberPO;
import com.finger.crowd.entity.vo.*;
import com.finger.crowd.util.ResultEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@FeignClient("finger-crowd-mysql")
public interface MySQLRemoteService {
    @RequestMapping("/get/remote/by/loginAcct")
    public ResultEntity loginAcct(@RequestParam("loginAcct") String loginAcct);

    @RequestMapping("/save/member/remote") // 这里一定要写requestBody 要不然服务器那边会接收不到数据！！！
    public ResultEntity<String> saveMember(@RequestBody MemberPO memberPO);

    @RequestMapping("/save/project/vo/remote")
    public ResultEntity saveProjectVO(@RequestBody ProjectVO projectVO,
                                      @RequestParam("memberId") Integer memberId);

    @RequestMapping("/get/all/portal/vo")
    public ResultEntity<List<PortalTypeVO>> getAllPortalProject();

    @RequestMapping("/get/detail/project/vo/remote")
    public ResultEntity<DetailProjectVO> getDetailProjectVO(@RequestParam("projectId") Integer projectId);

    @RequestMapping("/get/order/project/vo/remote")
    public ResultEntity<OrderProjectVO> getOrderProjectVORemote(@RequestParam("returnId") Integer returnId,
                                                                @RequestParam("projectId") Integer projectId);

    @RequestMapping("/get/address/by/memberId/remote")
    public ResultEntity<List<AddressVO>> getAllAddress(@RequestParam("memberId") Integer memberId);

    @RequestMapping("/save/address/remote")
    public ResultEntity<String> saveAddress(@RequestBody AddressVO addressVO);

    @RequestMapping("/save/order/vo")
    public ResultEntity<String> saveOrderVO(@RequestBody OrderVO orderVO);
}
